\(\int x^2 \sinh ^2(a+b x^2) \, dx\) [9]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 14, antiderivative size = 99 \[ \int x^2 \sinh ^2\left (a+b x^2\right ) \, dx=-\frac {x^3}{6}+\frac {e^{-2 a} \sqrt {\frac {\pi }{2}} \text {erf}\left (\sqrt {2} \sqrt {b} x\right )}{32 b^{3/2}}-\frac {e^{2 a} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\sqrt {2} \sqrt {b} x\right )}{32 b^{3/2}}+\frac {x \sinh \left (2 a+2 b x^2\right )}{8 b} \]

[Out]

-1/6*x^3+1/8*x*sinh(2*b*x^2+2*a)/b+1/64*erf(x*2^(1/2)*b^(1/2))*2^(1/2)*Pi^(1/2)/b^(3/2)/exp(2*a)-1/64*exp(2*a)
*erfi(x*2^(1/2)*b^(1/2))*2^(1/2)*Pi^(1/2)/b^(3/2)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {5448, 5433, 5406, 2235, 2236} \[ \int x^2 \sinh ^2\left (a+b x^2\right ) \, dx=\frac {\sqrt {\frac {\pi }{2}} e^{-2 a} \text {erf}\left (\sqrt {2} \sqrt {b} x\right )}{32 b^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} e^{2 a} \text {erfi}\left (\sqrt {2} \sqrt {b} x\right )}{32 b^{3/2}}+\frac {x \sinh \left (2 a+2 b x^2\right )}{8 b}-\frac {x^3}{6} \]

[In]

Int[x^2*Sinh[a + b*x^2]^2,x]

[Out]

-1/6*x^3 + (Sqrt[Pi/2]*Erf[Sqrt[2]*Sqrt[b]*x])/(32*b^(3/2)*E^(2*a)) - (E^(2*a)*Sqrt[Pi/2]*Erfi[Sqrt[2]*Sqrt[b]
*x])/(32*b^(3/2)) + (x*Sinh[2*a + 2*b*x^2])/(8*b)

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 5406

Int[Sinh[(c_.) + (d_.)*(x_)^(n_)], x_Symbol] :> Dist[1/2, Int[E^(c + d*x^n), x], x] - Dist[1/2, Int[E^(-c - d*
x^n), x], x] /; FreeQ[{c, d}, x] && IGtQ[n, 1]

Rule 5433

Int[Cosh[(c_.) + (d_.)*(x_)^(n_)]*((e_.)*(x_))^(m_.), x_Symbol] :> Simp[e^(n - 1)*(e*x)^(m - n + 1)*(Sinh[c +
d*x^n]/(d*n)), x] - Dist[e^n*((m - n + 1)/(d*n)), Int[(e*x)^(m - n)*Sinh[c + d*x^n], x], x] /; FreeQ[{c, d, e}
, x] && IGtQ[n, 0] && LtQ[0, n, m + 1]

Rule 5448

Int[((e_.)*(x_))^(m_.)*((a_.) + (b_.)*Sinh[(c_.) + (d_.)*(x_)^(n_)])^(p_), x_Symbol] :> Int[ExpandTrigReduce[(
e*x)^m, (a + b*Sinh[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[p, 1] && IGtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {x^2}{2}+\frac {1}{2} x^2 \cosh \left (2 a+2 b x^2\right )\right ) \, dx \\ & = -\frac {x^3}{6}+\frac {1}{2} \int x^2 \cosh \left (2 a+2 b x^2\right ) \, dx \\ & = -\frac {x^3}{6}+\frac {x \sinh \left (2 a+2 b x^2\right )}{8 b}-\frac {\int \sinh \left (2 a+2 b x^2\right ) \, dx}{8 b} \\ & = -\frac {x^3}{6}+\frac {x \sinh \left (2 a+2 b x^2\right )}{8 b}+\frac {\int e^{-2 a-2 b x^2} \, dx}{16 b}-\frac {\int e^{2 a+2 b x^2} \, dx}{16 b} \\ & = -\frac {x^3}{6}+\frac {e^{-2 a} \sqrt {\frac {\pi }{2}} \text {erf}\left (\sqrt {2} \sqrt {b} x\right )}{32 b^{3/2}}-\frac {e^{2 a} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\sqrt {2} \sqrt {b} x\right )}{32 b^{3/2}}+\frac {x \sinh \left (2 a+2 b x^2\right )}{8 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.16 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.02 \[ \int x^2 \sinh ^2\left (a+b x^2\right ) \, dx=\frac {3 \sqrt {2 \pi } \text {erf}\left (\sqrt {2} \sqrt {b} x\right ) (\cosh (2 a)-\sinh (2 a))-3 \sqrt {2 \pi } \text {erfi}\left (\sqrt {2} \sqrt {b} x\right ) (\cosh (2 a)+\sinh (2 a))+8 \sqrt {b} x \left (-4 b x^2+3 \sinh \left (2 \left (a+b x^2\right )\right )\right )}{192 b^{3/2}} \]

[In]

Integrate[x^2*Sinh[a + b*x^2]^2,x]

[Out]

(3*Sqrt[2*Pi]*Erf[Sqrt[2]*Sqrt[b]*x]*(Cosh[2*a] - Sinh[2*a]) - 3*Sqrt[2*Pi]*Erfi[Sqrt[2]*Sqrt[b]*x]*(Cosh[2*a]
 + Sinh[2*a]) + 8*Sqrt[b]*x*(-4*b*x^2 + 3*Sinh[2*(a + b*x^2)]))/(192*b^(3/2))

Maple [A] (verified)

Time = 0.53 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.91

method result size
risch \(-\frac {x^{3}}{6}-\frac {{\mathrm e}^{-2 a} x \,{\mathrm e}^{-2 x^{2} b}}{16 b}+\frac {{\mathrm e}^{-2 a} \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (x \sqrt {2}\, \sqrt {b}\right )}{64 b^{\frac {3}{2}}}+\frac {{\mathrm e}^{2 a} x \,{\mathrm e}^{2 x^{2} b}}{16 b}-\frac {{\mathrm e}^{2 a} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-2 b}\, x \right )}{32 b \sqrt {-2 b}}\) \(90\)

[In]

int(x^2*sinh(b*x^2+a)^2,x,method=_RETURNVERBOSE)

[Out]

-1/6*x^3-1/16*exp(-2*a)/b*x*exp(-2*x^2*b)+1/64*exp(-2*a)/b^(3/2)*Pi^(1/2)*2^(1/2)*erf(x*2^(1/2)*b^(1/2))+1/16*
exp(2*a)/b*x*exp(2*x^2*b)-1/32*exp(2*a)/b*Pi^(1/2)/(-2*b)^(1/2)*erf((-2*b)^(1/2)*x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 427 vs. \(2 (71) = 142\).

Time = 0.26 (sec) , antiderivative size = 427, normalized size of antiderivative = 4.31 \[ \int x^2 \sinh ^2\left (a+b x^2\right ) \, dx=-\frac {32 \, b^{2} x^{3} \cosh \left (b x^{2} + a\right )^{2} - 12 \, b x \cosh \left (b x^{2} + a\right )^{4} - 48 \, b x \cosh \left (b x^{2} + a\right ) \sinh \left (b x^{2} + a\right )^{3} - 12 \, b x \sinh \left (b x^{2} + a\right )^{4} - 3 \, \sqrt {2} \sqrt {\pi } {\left (\cosh \left (b x^{2} + a\right )^{2} \cosh \left (2 \, a\right ) + {\left (\cosh \left (2 \, a\right ) + \sinh \left (2 \, a\right )\right )} \sinh \left (b x^{2} + a\right )^{2} + \cosh \left (b x^{2} + a\right )^{2} \sinh \left (2 \, a\right ) + 2 \, {\left (\cosh \left (b x^{2} + a\right ) \cosh \left (2 \, a\right ) + \cosh \left (b x^{2} + a\right ) \sinh \left (2 \, a\right )\right )} \sinh \left (b x^{2} + a\right )\right )} \sqrt {-b} \operatorname {erf}\left (\sqrt {2} \sqrt {-b} x\right ) - 3 \, \sqrt {2} \sqrt {\pi } {\left (\cosh \left (b x^{2} + a\right )^{2} \cosh \left (2 \, a\right ) + {\left (\cosh \left (2 \, a\right ) - \sinh \left (2 \, a\right )\right )} \sinh \left (b x^{2} + a\right )^{2} - \cosh \left (b x^{2} + a\right )^{2} \sinh \left (2 \, a\right ) + 2 \, {\left (\cosh \left (b x^{2} + a\right ) \cosh \left (2 \, a\right ) - \cosh \left (b x^{2} + a\right ) \sinh \left (2 \, a\right )\right )} \sinh \left (b x^{2} + a\right )\right )} \sqrt {b} \operatorname {erf}\left (\sqrt {2} \sqrt {b} x\right ) + 8 \, {\left (4 \, b^{2} x^{3} - 9 \, b x \cosh \left (b x^{2} + a\right )^{2}\right )} \sinh \left (b x^{2} + a\right )^{2} + 12 \, b x + 16 \, {\left (4 \, b^{2} x^{3} \cosh \left (b x^{2} + a\right ) - 3 \, b x \cosh \left (b x^{2} + a\right )^{3}\right )} \sinh \left (b x^{2} + a\right )}{192 \, {\left (b^{2} \cosh \left (b x^{2} + a\right )^{2} + 2 \, b^{2} \cosh \left (b x^{2} + a\right ) \sinh \left (b x^{2} + a\right ) + b^{2} \sinh \left (b x^{2} + a\right )^{2}\right )}} \]

[In]

integrate(x^2*sinh(b*x^2+a)^2,x, algorithm="fricas")

[Out]

-1/192*(32*b^2*x^3*cosh(b*x^2 + a)^2 - 12*b*x*cosh(b*x^2 + a)^4 - 48*b*x*cosh(b*x^2 + a)*sinh(b*x^2 + a)^3 - 1
2*b*x*sinh(b*x^2 + a)^4 - 3*sqrt(2)*sqrt(pi)*(cosh(b*x^2 + a)^2*cosh(2*a) + (cosh(2*a) + sinh(2*a))*sinh(b*x^2
 + a)^2 + cosh(b*x^2 + a)^2*sinh(2*a) + 2*(cosh(b*x^2 + a)*cosh(2*a) + cosh(b*x^2 + a)*sinh(2*a))*sinh(b*x^2 +
 a))*sqrt(-b)*erf(sqrt(2)*sqrt(-b)*x) - 3*sqrt(2)*sqrt(pi)*(cosh(b*x^2 + a)^2*cosh(2*a) + (cosh(2*a) - sinh(2*
a))*sinh(b*x^2 + a)^2 - cosh(b*x^2 + a)^2*sinh(2*a) + 2*(cosh(b*x^2 + a)*cosh(2*a) - cosh(b*x^2 + a)*sinh(2*a)
)*sinh(b*x^2 + a))*sqrt(b)*erf(sqrt(2)*sqrt(b)*x) + 8*(4*b^2*x^3 - 9*b*x*cosh(b*x^2 + a)^2)*sinh(b*x^2 + a)^2
+ 12*b*x + 16*(4*b^2*x^3*cosh(b*x^2 + a) - 3*b*x*cosh(b*x^2 + a)^3)*sinh(b*x^2 + a))/(b^2*cosh(b*x^2 + a)^2 +
2*b^2*cosh(b*x^2 + a)*sinh(b*x^2 + a) + b^2*sinh(b*x^2 + a)^2)

Sympy [F]

\[ \int x^2 \sinh ^2\left (a+b x^2\right ) \, dx=\int x^{2} \sinh ^{2}{\left (a + b x^{2} \right )}\, dx \]

[In]

integrate(x**2*sinh(b*x**2+a)**2,x)

[Out]

Integral(x**2*sinh(a + b*x**2)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.96 \[ \int x^2 \sinh ^2\left (a+b x^2\right ) \, dx=-\frac {1}{6} \, x^{3} - \frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (\sqrt {2} \sqrt {-b} x\right ) e^{\left (2 \, a\right )}}{64 \, \sqrt {-b} b} + \frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (\sqrt {2} \sqrt {b} x\right ) e^{\left (-2 \, a\right )}}{64 \, b^{\frac {3}{2}}} + \frac {x e^{\left (2 \, b x^{2} + 2 \, a\right )}}{16 \, b} - \frac {x e^{\left (-2 \, b x^{2} - 2 \, a\right )}}{16 \, b} \]

[In]

integrate(x^2*sinh(b*x^2+a)^2,x, algorithm="maxima")

[Out]

-1/6*x^3 - 1/64*sqrt(2)*sqrt(pi)*erf(sqrt(2)*sqrt(-b)*x)*e^(2*a)/(sqrt(-b)*b) + 1/64*sqrt(2)*sqrt(pi)*erf(sqrt
(2)*sqrt(b)*x)*e^(-2*a)/b^(3/2) + 1/16*x*e^(2*b*x^2 + 2*a)/b - 1/16*x*e^(-2*b*x^2 - 2*a)/b

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.98 \[ \int x^2 \sinh ^2\left (a+b x^2\right ) \, dx=-\frac {1}{6} \, x^{3} + \frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\sqrt {2} \sqrt {-b} x\right ) e^{\left (2 \, a\right )}}{64 \, \sqrt {-b} b} - \frac {\sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\sqrt {2} \sqrt {b} x\right ) e^{\left (-2 \, a\right )}}{64 \, b^{\frac {3}{2}}} + \frac {x e^{\left (2 \, b x^{2} + 2 \, a\right )}}{16 \, b} - \frac {x e^{\left (-2 \, b x^{2} - 2 \, a\right )}}{16 \, b} \]

[In]

integrate(x^2*sinh(b*x^2+a)^2,x, algorithm="giac")

[Out]

-1/6*x^3 + 1/64*sqrt(2)*sqrt(pi)*erf(-sqrt(2)*sqrt(-b)*x)*e^(2*a)/(sqrt(-b)*b) - 1/64*sqrt(2)*sqrt(pi)*erf(-sq
rt(2)*sqrt(b)*x)*e^(-2*a)/b^(3/2) + 1/16*x*e^(2*b*x^2 + 2*a)/b - 1/16*x*e^(-2*b*x^2 - 2*a)/b

Mupad [F(-1)]

Timed out. \[ \int x^2 \sinh ^2\left (a+b x^2\right ) \, dx=\int x^2\,{\mathrm {sinh}\left (b\,x^2+a\right )}^2 \,d x \]

[In]

int(x^2*sinh(a + b*x^2)^2,x)

[Out]

int(x^2*sinh(a + b*x^2)^2, x)